package 面向对象_中.a继承.练习1基本操作;

/**
 * @Projectname java_based
 * @Filename Kids
 * @Author an
 * @Data 2022/6/29 21:37
 * @Description TODO
 */
/*
 * 定义类Kids继承ManKind，并包括
 * 成员变量int yearsOld；
 * 方法printAge()打印yearsOld的值
 *
 */
public class Kids extends ManKind{

    private int yearsOld;	//年限

    public Kids() {


    }

    public Kids(int yearsOld) {
        this.yearsOld = yearsOld;
    }

    public int getYearsOld() {
        return yearsOld;
    }

    public void setYearsOld(int yearsOld) {
        this.yearsOld = yearsOld;
    }

    public void printAge(){
        System.out.println("I am " + yearsOld);
    }
}
